import request from '@/config/axios'

export interface RatingVO{
  id: number
  doctorId: number
  patientId: number
  rating: string
}

// 基于用户的推荐
export const getUserBasedRecommendations = (patientId: number, limit :number) => {
  return request.get({ url: '/medical/rating/user-based/' + patientId + '?limit=' + limit })
}

// 基于医师的推荐
export const getItemBasedRecommendations = (patientId: number, limit :number) => {
  return request.get({ url: '/medical/rating/item-based/' + patientId + '?limit=' + limit})
}

// 混合推荐
export const getHybridRecommendations = (patientId: number, limit :number) => {
  return request.get({ url: '/medical/rating/hybrid/' + patientId + '?limit=' + limit})
}

// 创建评分
export const createRating = (data: RatingVO) => {
  return request.post({ url: '/medical/rating/create', data })
}

// 检查评分是否存在
export const checkRatedExits = (patientId: number, doctorId :number) => {
  return request.get({ url: '/medical/rating/check' + '?patientId=' 
    + patientId + '&doctorId=' + doctorId })
}